define(['backbone',
        'underscore',
        'jquery'
],
function (Backbone, _, $) {
    var MyClass= function () {
        
    };
    MyClass.prototype.getCurrentLocation = function (fnCallbackSuccess,fnCallbackError) {

        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function (position) {
                //success
                var lat = position.coords.latitude;
                var lon = position.coords.longitude;
                $.ajax({
                    url: 'http://maps.googleapis.com/maps/api/geocode/json',
                    data: {
                        latlng: lat + "," + lon
                    },
                    success: function (res) {
                        placeDetail = res;
                        console.log(res);
                        if (fnCallbackSuccess) {
                            fnCallbackSuccess(res.results[0].address_components[5]);
                        }
                    },
                    error: fnCallbackError
                });


            }, fnCallbackError);
        } else {
            console.log("Geolocation is not supported by this browser.");
        }
    };
   
    return MyClass;
});